from flask import Flask,request

app = Flask(__name__)

#路由地址
@app.route('/upload',methods=['POST'])
def index():
    f = request.files.get('pic')
    fname = f.filename
    with open(f'./imgs/{fname}','wb') as tf:
        tf.write(f.read())

    return f'上传成功'

if __name__ == '__main__':
    #启动web应用服务
    app.run(debug=True)